package iconSwingStates.Applications_Exemple.Paint;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;

import javax.swing.JButton;
import javax.swing.JColorChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import fr.lri.swingstates.canvas.CRectangle;
import fr.lri.swingstates.canvas.Canvas;
import fr.lri.swingstates.debug.StateMachineVisualization;



public class ExampleApplication {
	
	public static void main(String[] args) throws IllegalArgumentException, IllegalAccessException {
		//Création de la frame et du canvas
		Canvas c=new Canvas(1000,600);
		
		JFrame frame = new JFrame("Test ICon Swingstates bridge");
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(1000, 600);
		frame.add(c);
		
		//Création des machines à états utilisées
		String[] pointers = {"mouse1"};
		SMDraw sm = new SMDraw("SMDraw",frame, c,pointers);
		SMPalette palette = new SMPalette("SMPalette",frame, c,pointers);
		SMSelectionTool st = new SMSelectionTool("SMSelectionTool",frame,c,sm,palette);

		

		//On crée un fenêtre pour afficher les machines à états
		JFrame smviz = new JFrame("StateMachine Visualization");
		Container pane = smviz.getContentPane();
		JTabbedPane tab = new JTabbedPane();
		tab.add(new StateMachineVisualization(sm), "Drawing");
		tab.add(new StateMachineVisualization(st),"Selection");
		tab.add(new StateMachineVisualization(palette),"Palette");
		pane.add(tab);
		smviz.pack();
		smviz.setVisible(true);
		
//		On affiche la frame
		frame.setVisible(true);
	}

}